{
  "name"    : "server component",

  "include" :
  [
    {
      "path" : "${QOOXDOO_PATH}/tool/data/config/application.json",
      "block" :
      [
        "build",
        "build-script",
        "build-resources",
        "source",
        "source-script",
        "test"
      ]
    },
    {
      "path" : "./server.json"
    }
  ],

  /*
  "export" :
  [
    "api",
    "api-data",
    "build",
    "clean",
    "distclean",
    "info",
    "inspector",
    "migration",
    "profiling",
    "source",
    "test",
    "test-source"
  ],
  */
  
  "default-job" : "source-hybrid",

  "let" :
  {
    "APPLICATION"  : "server",
    "QOOXDOO_PATH" : "../../..",
    "QXTHEME"      : "server.theme.Theme",
    "API_EXCLUDE"  : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"],
    "LOCALES"      : [ "en" ],
    "CACHE"        : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache",
    "BUILD_PATH"   : "script",
    "ROOT"         : "."
  },

  "config-warnings" :
  {
    "job-shadowing" : 
    [
      "api",
      "apiconf::build-data",
      "distclean"
    ]
  },

  "jobs" :
  {
    // -- npm jobs -------------------------------------------------------------
    
    "npm-package-copy" :
    {
      "extend" : ["cache"],
      "shell" :
      {
        "command" : [
          "mkdir -p npm/build",
          "cp script/qx-oo-${QOOXDOO_VERSION}.js npm/build",
          "cp npm/package.json npm/build"
        ]
      }
    },

    "npm-package-test" :
    {
      "extend" : ["cache"],
      "shell" :
      {
        "command" : "cd test/npm && npm install ../../npm/build/ && node npm.js"
      }
    },

    "npm-package-publish" :
    {
      // relies on npm-package-copy having run
      "extend" : ["cache"],
      "shell" :
      {
        "command" : "cd npm/build && npm publish"
      }
    },

    // -- others ---------------------------------------------------------------

    "api" :
    {
      "desc" : "create api doc for qxoo",
      "=library" : [
        {
          "manifest" : "${QOOXDOO_PATH}/framework/Manifest.json"
        },
        {
          "manifest" : "${QOOXDOO_PATH}/component/apiviewer/Manifest.json"
        },
        {
          "manifest" : "${QOOXDOO_PATH}/component/library/versionlabel/Manifest.json"
        }
      ],
      "let" :
      {
        "BUILD_PATH"     : "./api",
        "API_INCLUDE"    : ["qx.Class", "qx.Mixin", "qx.Interface"],
        "API_EXCLUDE"    : ["qx.test.*", "qx.event.GlobalError"]
      }
    },

    "apiconf::build-data" : {
      "extend" : ["qxoo-common"],
      "compile-options": { "code" : { "optimize" : ["variants"] }}
    },
    
    "test" :
    {
      "let" :
      {
        "TESTRUNNER_ROOT" : "${QOOXDOO_PATH}/component/testrunner",
        "BUILD_SCRIPT_FILE" : "test/script/testrunner.js"
      },
      
      "run" :
      [
        "build-basic-portable",
        "test-replace"
      ]
    },
    
    "test-replace" : 
    {
      "extend" : ["cache"],
      "shell" : {
        "command" : "sed -i -e s/qx/__qx__/g ${BUILD_SCRIPT_FILE}"
      }
    },

    "distclean" : 
    {
      "=clean-files" :
      {
        "Deleting build" :
        [
          "${BUILD_PATH}"
        ],
        "Cleaning up source" :
        [
          "${ROOT}/source/script"
        ],
        "Deleting api folder" :
        [
          "${ROOT}/api"
        ],
        "Deleting test artefacts" :
        [
          "${ROOT}/test/script",
          "${ROOT}/test/npm/node_modules",
          "${ROOT}/npm/build"
        ],
        "Deleting inspector folder" :
        [
          "${ROOT}/inspector"
        ],
        "Deleting simulator folder" :
        [
          "${ROOT}/simulator"
        ]
      }
    }
  }
}
